package org.guage.process.task.config;

import org.guage.process.task.schedule.JvmLoggerTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * {@link EnableAutoConfiguration Auto-configuration}jvm信息收集配置类 
 * 将LocalLogMetricsEndpoint对象注入到spring容器
 * @since 2.3.X
 */
@Configuration
@ConditionalOnProperty(prefix = "application.log.process", name = "enable", havingValue = "true", matchIfMissing = true)
@EnableScheduling
public class DbpoolConfig {
	
	private final Logger log = LoggerFactory.getLogger(DbpoolConfig.class);
	
	@Bean
	@ConditionalOnMissingBean
	public JvmLoggerTask restJvmLoggerTask() {
		log.info("初始化JvmLoggerTask");
		return new JvmLoggerTask();
	}
}
